package com.hd123.rumba.gwt.widget2.client.grid;

import java.util.ArrayList;
import java.util.Iterator;

import com.google.gwt.user.client.ui.Widget;

/**
 * RGridClickListener集合
 * 
 * @author LiQi
 * 
 */
public class RGridClickListenerCollection extends ArrayList {

  private static final long serialVersionUID = 1L;

  /**
   * 触发所有监听器的click事件
   * 
   * @param grid
   *          触发事件的RGrid
   * @param colDef
   *          被点击单元格所在列的列定义
   * @param row
   *          行序号，包含表格的表头和表尾
   * @param col
   *          可见列序号
   * @param sender
   *          被点击的控件
   */
  public void fireClick(RGrid grid, RGridColumnDef colDef, int row, int col, Widget sender) {
    for (Iterator it = iterator(); it.hasNext();) {
      RGridClickListener listener = (RGridClickListener) it.next();
      listener.onClick(grid, colDef, row, col, sender);
    }
  }
}
